package com.qy139.studyrecord.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qy139.entity.StudyRecord;
import com.qy139.studyrecord.mapper.StudyRecordMapper;
import com.qy139.studyrecord.service.IStudyRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author huyueheng
 * @since 2021-12-15
 */
@Service
public class StudyRecordServiceImpl extends ServiceImpl<StudyRecordMapper, StudyRecord> implements IStudyRecordService {

    @Resource
    private StudyRecordMapper studyRecordMapper;
    @Override
    public IPage findAll(Page page, String name) {
        return studyRecordMapper.findAll(page,name);
    }

    @Override
    public IPage findcount(Page page, String name) {
        return studyRecordMapper.findcount(page,name);
    }

    @Override
    public int insertRecord(StudyRecord studyRecord) {
        studyRecordMapper.insertRecord(studyRecord);
        return studyRecord.getId();
    }

    @Override
    public int updateleavetime(StudyRecord studyRecord) {
        return studyRecordMapper.updateleavetime(studyRecord);
    }
}
